# -*- coding: utf-8 -*-
# @Time : 2023/11/1 2:30 PM 
# @Author : Wayne
# @Email : 1
# @File : caiji_no_save.py
# @Project : python_demo
# @DESCRIPTION :

"""
{"success":true,"errorCode":"","subErrorCode":"","errorDesc":"","subErrorDesc":"","requestMethod":"gy.erp.shop.get","flag":null,"shops":[{"id":633001530716,"nick":"全江食品旗舰店","code":"101","name":"全江食品旗舰店-天猫","create_date":"2023-08-01 14:12:56","modify_date":"2023-08-01 14:16:10","note":"","type_name":"天猫"},{"id":633002748545,"nick":"黄山徽蒸坊腊味","code":"201","name":"黄山徽蒸坊腊味-拼多多","create_date":"2023-08-01 14:15:54","modify_date":"2023-08-01 14:15:54","note":"","type_name":"拼多多"}],"total":2}
# 打开文本文件 比如json格式数据信息，放在文件避免代码很臃肿
如果是一堆返回的数据做相关拼接或者处理，本地比较
类似附件如旁边
"""



file = open("/Users/wayne/Desktop/吉客云数据.txt", "r")

# 读取文件内容
data = file.read()

# 关闭文件
file.close()

# 输出文件内容
# print(data)

import json
data_dict = json.loads(data)

# 获取items键对应的值
items = data_dict["result"]['data']

# print("txt倒入的数据信息"+str(items))

target_No_list = []
for i in items:
    targetNo = i["itemCode"]
    target_No_list.append(targetNo)

file2 = open("/Users/wayne/Desktop/数据2.txt", "r")

# 读取文件内容
data2 = file2.read()

# 关闭文件
file.close()
data_dict2 = json.loads(data2)
items2 = data_dict2["result"]['data']
for i in items2:
    targetNo = i["itemCode"]
    target_No_list.append(targetNo)

set1 = set(target_No_list)
print(len(set1))